function ShapeBase(scene){
	this.id = new Date().getTime();
	this.position = {x:0,y:0,z:0};
	
	this.scene = scene;
	this.context = scene?this.scene.context:null;
	
	this.vertexBuffer = null;
	this.colorBuffer = null;
	this.indexBuffer = null;
	
	this.defaultColor = {r:1, g:0, b:0, a:1};
	
	this.animations = new Array();
	
	this.reset = function(){
		if(this.animations && this.animations.length>0)
			this.animations = new Array();
	}
	
	this.addAnimation = function(animation){
		this.animations.push(animation);
		this.scene.animationContext.add(animation);				
	}
	
	this.setMatrixUniforms = function () {
		if(this.scene.drawingShader.pMatrixUniform && this.scene.pMatrix)
			this.context.uniformMatrix4fv(this.scene.drawingShader.pMatrixUniform, false, this.scene.pMatrix);
		if(this.scene.drawingShader.mvMatrixUniform,this.scene.mvMatrix)
			this.context.uniformMatrix4fv(this.scene.drawingShader.mvMatrixUniform, false, this.scene.mvMatrix);
		if(this.scene.drawingShader.samplerUniform && this.scene.samplerUniform)
			this.context.uniformMatrix4fv(this.scene.drawingShader.samplerUniform, false, this.scene.samplerUniform);
	}
	
	this.initRandomColors =function(){
		if(!this.vertexBuffer)return;
		var points = [];
		for(var i=0;i<this.vertexBuffer.itemsCount;i++){
			var r = Math.floor((Math.random() * 255) + 1)/255;
			var g = Math.floor((Math.random() * 255) + 1)/255;
			var b = Math.floor((Math.random() * 255) + 1)/255;
			for(var j=0;j<this.vertexBuffer.itemSize;j++){	
				points.push(r);points.push(g);points.push(b);points.push(1);
			}
		}
		this.colorBuffer = new ArrayBuffer(this.context,points,4);
	}
}

